gtk4.git
7 years agonotebook: Fix up issues with property notification
Matthias Clasen [Thu, 21 Feb 2019 04:39:01 +0000 (23:39 -0500)]
notebook: Fix up issues with property notification

7 years agowidget-factory: Use notebook pages in the ui file
Matthias Clasen [Thu, 21 Feb 2019 04:05:37 +0000 (23:05 -0500)]
widget-factory: Use notebook pages in the ui file

This is the new way of doing things.

7 years agoprint dialog: Use notebook pages in ui file
Matthias Clasen [Thu, 21 Feb 2019 04:03:32 +0000 (23:03 -0500)]
print dialog: Use notebook pages in ui file

This is the new way of doing things.

7 years agobuilder-tool: Rewrite notebooks
Matthias Clasen [Thu, 21 Feb 2019 03:48:58 +0000 (22:48 -0500)]
builder-tool: Rewrite notebooks

Just like we do for assistant and stack pages, rewrite
notebooks from child properties to child metas.

7 years agoImplement position property somewhat
Matthias Clasen [Thu, 21 Feb 2019 03:25:54 +0000 (22:25 -0500)]
Implement position property somewhat

7 years agonotebook: Fix up ref counting
Matthias Clasen [Thu, 21 Feb 2019 04:02:39 +0000 (23:02 -0500)]
notebook: Fix up ref counting

We need to keep a ref to the page objects.

7 years agonotebook: Add a pages model
Matthias Clasen [Thu, 21 Feb 2019 02:46:20 +0000 (21:46 -0500)]
notebook: Add a pages model

Just like GtkStack and GtkAssistant, provide
a list model with the page objects.

7 years agoAllow builder to add notebook pages
Matthias Clasen [Wed, 20 Feb 2019 16:43:15 +0000 (11:43 -0500)]
Allow builder to add notebook pages

7 years agoTurn labels into page properties
Matthias Clasen [Wed, 20 Feb 2019 13:39:21 +0000 (08:39 -0500)]
Turn labels into page properties

7 years agoAdd GtkNotebookPage properties
Matthias Clasen [Wed, 20 Feb 2019 04:03:22 +0000 (23:03 -0500)]
Add GtkNotebookPage properties

7 years agoMake GtkNotebookPage an object
Matthias Clasen [Tue, 19 Feb 2019 23:44:40 +0000 (18:44 -0500)]
Make GtkNotebookPage an object

7 years agonotebook: Rename an internal macro
Matthias Clasen [Tue, 19 Feb 2019 23:28:53 +0000 (18:28 -0500)]
notebook: Rename an internal macro

Avoid a clash between GObject boilerplate and the
GTK_NOTEBOOK_PAGE() macro, by renaming it.

7 years agoassistant: Remove weak pointer in finalize
Matthias Clasen [Thu, 21 Feb 2019 02:45:11 +0000 (21:45 -0500)]
assistant: Remove weak pointer in finalize

Otherwise, bad things can happen later, if
somebody holds onto the list model.

7 years agocss tests: Update expected output for entries
Matthias Clasen [Thu, 21 Feb 2019 05:27:51 +0000 (00:27 -0500)]
css tests: Update expected output for entries

Flat is gone.

7 years agotext: Remove has-frame leftovers
Matthias Clasen [Thu, 21 Feb 2019 04:20:27 +0000 (23:20 -0500)]
text: Remove has-frame leftovers

7 years agotext: Make this a final class
Matthias Clasen [Wed, 20 Feb 2019 18:10:33 +0000 (13:10 -0500)]
text: Make this a final class

No need to derive from it.

7 years agosearch entry: Quiet a compiler warning
Matthias Clasen [Wed, 20 Feb 2019 18:10:09 +0000 (13:10 -0500)]
search entry: Quiet a compiler warning

7 years agotext: Remove the ::has-frame property
Matthias Clasen [Wed, 20 Feb 2019 15:34:42 +0000 (10:34 -0500)]
text: Remove the ::has-frame property

This is purely GtkEntry functionality and should
remain there.

7 years agoemoji chooser: Don't use entry api on search entries
Matthias Clasen [Wed, 20 Feb 2019 15:32:12 +0000 (10:32 -0500)]
emoji chooser: Don't use entry api on search entries

Use editable api, and cut through to the text widget
where necessary.

7 years agosearch entry: Add private api to get the text widget
Matthias Clasen [Wed, 20 Feb 2019 15:29:26 +0000 (10:29 -0500)]
search entry: Add private api to get the text widget

We need this to do some custom setup in the Emoji chooser.

7 years agowidget: Mark compute functions as G_GNUC_WARN_UNUSED_RESULT
Benjamin Otte [Wed, 20 Feb 2019 04:00:13 +0000 (05:00 +0100)]
widget: Mark compute functions as G_GNUC_WARN_UNUSED_RESULT

Lots of code does not error-check these functions, and when we add CSS
transforms, they will start failing. And we want people to check that.

7 years agogtk: Check return value of compute_bounds()
Benjamin Otte [Wed, 20 Feb 2019 03:53:47 +0000 (04:53 +0100)]
gtk: Check return value of compute_bounds()

Half of these calls will completely break if anybody ever uses CSS
transforms with them, but hey...

7 years agowidget: Always set out value
Benjamin Otte [Wed, 20 Feb 2019 03:07:34 +0000 (04:07 +0100)]
widget: Always set out value

Don't leave memory in an unitinialized case when returning FALSE from
gtk_widget_compute_transform().

We both know that people are going to call that function without
checking the return value.

7 years agowidget: Fail if matrix not invertible
Benjamin Otte [Wed, 20 Feb 2019 03:05:37 +0000 (04:05 +0100)]
widget: Fail if matrix not invertible

7 years agowidget: Add optimizations to gtk_widget_compute_transform()
Benjamin Otte [Wed, 20 Feb 2019 03:04:29 +0000 (04:04 +0100)]
widget: Add optimizations to gtk_widget_compute_transform()

Try to catch 2 common cases with as little work as necessary.

7 years agowidget: Clean up gtk_widget_compute_transform()
Benjamin Otte [Wed, 20 Feb 2019 02:46:28 +0000 (03:46 +0100)]
widget: Clean up gtk_widget_compute_transform()

The code was all over the place and being clear here is very useful.

7 years agoFix gtk_widget_compute_transform
Matthias Clasen [Wed, 20 Feb 2019 00:29:56 +0000 (19:29 -0500)]
Fix gtk_widget_compute_transform

We were collecting all the transforms from widget
up to ancestor, and then trying to collect the
ones from target to ancestor, but failing.

7 years agowidget: Remove gtk_widget_get_allocated_size()
Benjamin Otte [Tue, 19 Feb 2019 07:09:57 +0000 (08:09 +0100)]
widget: Remove gtk_widget_get_allocated_size()

Use gtk_widget_get_allocated_width/height in the only user (GtkStack),
even though that isn't 100% correct.

7 years agoAdd test for widget transforms
Timm Bäder [Sat, 11 Aug 2018 20:19:13 +0000 (22:19 +0200)]
Add test for widget transforms

7 years agowidget: Add gtk_widget_compute_point()
Benjamin Otte [Tue, 19 Feb 2019 18:15:16 +0000 (19:15 +0100)]
widget: Add gtk_widget_compute_point()

It's the replacement for gtk_widget_translate_coordinates()

7 years agoRemove nonexisting function from header
Benjamin Otte [Tue, 19 Feb 2019 17:02:46 +0000 (18:02 +0100)]
Remove nonexisting function from header

7 years agowidget: Compute child point directly when picking
Timm Bäder [Tue, 19 Feb 2019 07:51:51 +0000 (08:51 +0100)]
widget: Compute child point directly when picking

7 years agowidget: Remove unused function
Timm Bäder [Tue, 19 Feb 2019 07:33:24 +0000 (08:33 +0100)]
widget: Remove unused function

7 years agowidget: Avoid some type checks in pick() and contains()
Timm Bäder [Tue, 19 Feb 2019 07:25:49 +0000 (08:25 +0100)]
widget: Avoid some type checks in pick() and contains()

We've already verified that the given pointer is a proper GtkWidget, so
no need to do it all over again.

7 years agowidget: Add typecheck-less _is_sensitive
Timm Bäder [Tue, 19 Feb 2019 07:24:43 +0000 (08:24 +0100)]
widget: Add typecheck-less _is_sensitive

It adds up to a whopping 3% in gtk_widget_pick

7 years agowidget: Add gtk_widget_compute_transform
Timm Bäder [Sun, 17 Feb 2019 07:47:09 +0000 (08:47 +0100)]
widget: Add gtk_widget_compute_transform

7 years agowidget: Use CSS boxes in gtk_widget_real_contains()
Timm Bäder [Tue, 19 Feb 2019 16:19:23 +0000 (17:19 +0100)]
widget: Use CSS boxes in gtk_widget_real_contains()

7 years agostack sidebar: Fix sorting
Matthias Clasen [Tue, 19 Feb 2019 16:22:33 +0000 (11:22 -0500)]
stack sidebar: Fix sorting

Fix sorting, by not sorting.

7 years agoMerge branch 'portal-session-state-master' into 'master'
Matthias Clasen [Tue, 19 Feb 2019 12:35:14 +0000 (12:35 +0000)]
Merge branch 'portal-session-state-master' into 'master'

Portal session state

See merge request GNOME/gtk!587

7 years agoapplication: Add a query-end signal
Matthias Clasen [Tue, 22 Jan 2019 01:45:15 +0000 (20:45 -0500)]
application: Add a query-end signal

This lets us take just-in-time inhibitors, and makes
the session support a little more real.

7 years agoApplication: Support sandboxed session state changes
Matthias Clasen [Sun, 20 Jan 2019 16:29:04 +0000 (11:29 -0500)]
Application: Support sandboxed session state changes

React to the session-state in StateChanged signals from
the inhibit portal and call QueryEndResponse as appropriate.

7 years agowidget: Remove lefover debug code
Benjamin Otte [Tue, 19 Feb 2019 05:47:35 +0000 (06:47 +0100)]
widget: Remove lefover debug code

According to someone involved with those lines, I suck at reviewing
their patches.

7 years agoMerge branch 'text' into 'master'
Matthias Clasen [Tue, 19 Feb 2019 05:45:44 +0000 (05:45 +0000)]
Merge branch 'text' into 'master'

GtkEntry reshuffling

Closes #1483

See merge request GNOME/gtk!585

7 years agosearch entry: Add a tooltip to th clear icon
Matthias Clasen [Tue, 19 Feb 2019 05:32:35 +0000 (00:32 -0500)]
search entry: Add a tooltip to th clear icon

Similar to what we do for the caps-lock warning in the
password entry.

Closes #1483

7 years agoMention GtkEditable and entries in the migration guide
Matthias Clasen [Tue, 19 Feb 2019 05:10:24 +0000 (00:10 -0500)]
Mention GtkEditable and entries in the migration guide

Not a very exhaustive treatment, but at least it gives
some hints.

7 years agoAdd editable delegate api to docs
Matthias Clasen [Tue, 19 Feb 2019 04:42:06 +0000 (23:42 -0500)]
Add editable delegate api to docs

And add a section that explains how to use these
functions when setting up a GtkEditable delegate.

7 years agoFix testtreesort warnings
Matthias Clasen [Sun, 17 Feb 2019 23:18:20 +0000 (18:18 -0500)]
Fix testtreesort warnings

7 years agoa11y text test: Use a GtkText instead
Matthias Clasen [Sun, 17 Feb 2019 20:52:33 +0000 (15:52 -0500)]
a11y text test: Use a GtkText instead

7 years agoa11y tests: Update expected output
Matthias Clasen [Sun, 17 Feb 2019 20:52:10 +0000 (15:52 -0500)]
a11y tests: Update expected output

GtkText makes an appearance in many places now.

7 years agofocus test: Use a GtkText instead
Matthias Clasen [Sun, 17 Feb 2019 20:51:31 +0000 (15:51 -0500)]
focus test: Use a GtkText instead

Thats where the focus is nowadays.

7 years agodefaultvalue test: Exempt GtkText::buffer
Matthias Clasen [Sun, 17 Feb 2019 20:50:59 +0000 (15:50 -0500)]
defaultvalue test: Exempt GtkText::buffer

It gets created on-demand, so isn't NULL.

7 years agotestsuite: update css node tests
Matthias Clasen [Sun, 17 Feb 2019 20:18:00 +0000 (15:18 -0500)]
testsuite: update css node tests

The entries have changed. Reflect that.

7 years agowidget-factory: Don't set can-focus on entries
Matthias Clasen [Mon, 18 Feb 2019 19:23:14 +0000 (14:23 -0500)]
widget-factory: Don't set can-focus on entries

The focus needs to be on the text inside, now.

7 years agofile chooser: Use editable api on the search entry
Matthias Clasen [Sun, 17 Feb 2019 19:48:44 +0000 (14:48 -0500)]
file chooser: Use editable api on the search entry

7 years agofont chooser: Use editable api on search entry
Matthias Clasen [Sun, 17 Feb 2019 19:48:08 +0000 (14:48 -0500)]
font chooser: Use editable api on search entry

7 years agoapp chooser: Use editable api on search entry
Matthias Clasen [Sun, 17 Feb 2019 19:47:53 +0000 (14:47 -0500)]
app chooser: Use editable api on search entry

7 years agoFix the search bar example
Matthias Clasen [Sun, 17 Feb 2019 21:13:58 +0000 (16:13 -0500)]
Fix the search bar example

More GtkSearchBar entry -> editable fixups.

7 years agogtk-demo: Make the delayed search demo work
Matthias Clasen [Sun, 17 Feb 2019 04:59:39 +0000 (23:59 -0500)]
gtk-demo: Make the delayed search demo work

Make this demo work with the new search entry.

7 years agoinspector: Work with new search entry
Matthias Clasen [Sun, 17 Feb 2019 04:58:54 +0000 (23:58 -0500)]
inspector: Work with new search entry

Don't assume a search entry is an entry, and
use the editable api as far as possible.

7 years agotreeview: make search work
Matthias Clasen [Sun, 17 Feb 2019 04:56:15 +0000 (23:56 -0500)]
treeview: make search work

Make search work with both GtkEntry and GtkSearchEntry,
even if a GtkSearchEntry is not derived from GtkEntry
anymore.

7 years agosearch bar: Work with the new GtkSearchEntry
Matthias Clasen [Sun, 17 Feb 2019 04:58:06 +0000 (23:58 -0500)]
search bar: Work with the new GtkSearchEntry

Don't assume a search entry is an entry, and use
the editable api as far as possible.

7 years agosearch entry: Use a GtkText
Matthias Clasen [Sun, 17 Feb 2019 04:57:18 +0000 (23:57 -0500)]
search entry: Use a GtkText

7 years agoAdd a test for GtkPassworkEntry
Matthias Clasen [Sun, 17 Feb 2019 03:22:43 +0000 (22:22 -0500)]
Add a test for GtkPassworkEntry

7 years agoAdd GtkPasswordEntry
Matthias Clasen [Sun, 17 Feb 2019 03:21:57 +0000 (22:21 -0500)]
Add GtkPasswordEntry

This is a simple editable which hides the entered
text and shows a caps-lock warning.

7 years agoentry completion: Make this work again
Matthias Clasen [Mon, 18 Feb 2019 04:03:27 +0000 (23:03 -0500)]
entry completion: Make this work again

Connect to GtkText signals where necessary.

7 years agotreeview: use a GtkText as search entry
Matthias Clasen [Sat, 16 Feb 2019 17:29:48 +0000 (12:29 -0500)]
treeview: use a GtkText as search entry

7 years agotreeview: Disable some search entry functionality
Matthias Clasen [Sat, 16 Feb 2019 05:53:09 +0000 (00:53 -0500)]
treeview: Disable some search entry functionality

This needs to be rewritten. Until then, keep it limping along.

7 years agosearch entry: temporarily disable some functions
Matthias Clasen [Sat, 16 Feb 2019 05:52:20 +0000 (00:52 -0500)]
search entry: temporarily disable some functions

The search entry needs to be rewritten to use a
text child until then, keep it limping along.

7 years agospin button: Use GtkText
Matthias Clasen [Sat, 16 Feb 2019 02:01:33 +0000 (21:01 -0500)]
spin button: Use GtkText

We already use GtkEditable api throughout. This just
means we create a GtkText instead of a GtkEntry.

7 years agoentry accessible: Make this work with the text widget
Matthias Clasen [Sat, 16 Feb 2019 05:50:12 +0000 (00:50 -0500)]
entry accessible: Make this work with the text widget

7 years agoentry: Delegate to GtkText
Matthias Clasen [Sat, 16 Feb 2019 05:50:40 +0000 (00:50 -0500)]
entry: Delegate to GtkText

Use a GtkText child, and delegate the editable functionality
to it. Also forward all the properties that are provided by
GtkText.

Some of the more internal APIs, such as layout and im context
access and caps-lock warning, are removed here, but we preserve
most of the plain GtkEntry API by forwarding it to the GtkText
child.

7 years agowidget: Fix gtk_widget_size_allocate()
Benjamin Otte [Tue, 19 Feb 2019 04:50:49 +0000 (05:50 +0100)]
widget: Fix gtk_widget_size_allocate()

Compute the matrix for adjusted sizes etc properly.

7 years agorecorder: Print the matrix for transform nodes
Benjamin Otte [Tue, 19 Feb 2019 03:16:00 +0000 (04:16 +0100)]
recorder: Print the matrix for transform nodes

7 years agoAdd a GtkTextAccessible
Matthias Clasen [Sat, 16 Feb 2019 02:30:36 +0000 (21:30 -0500)]
Add a GtkTextAccessible

Add an accessible implementation for GtkText.

7 years agoMake emoji completion work for GtkText
Matthias Clasen [Fri, 15 Feb 2019 20:46:51 +0000 (15:46 -0500)]
Make emoji completion work for GtkText

GtkEntry will stop using it directly in the following commits.

7 years agoAdd a GtkText widget
Matthias Clasen [Thu, 14 Feb 2019 01:16:12 +0000 (20:16 -0500)]
Add a GtkText widget

This is a GtkEntry without any of the extras, such as
icons, completion, progress, caps-lock warning, emoji icon.

7 years agospin button: Implement and use editable interface
Matthias Clasen [Thu, 14 Feb 2019 05:54:07 +0000 (00:54 -0500)]
spin button: Implement and use editable interface

7 years agoentry: Implement new editable iface
Matthias Clasen [Thu, 14 Feb 2019 04:07:36 +0000 (23:07 -0500)]
entry: Implement new editable iface

7 years agoeditable: Add more to interface
Matthias Clasen [Thu, 14 Feb 2019 01:16:33 +0000 (20:16 -0500)]
editable: Add more to interface

Add all the things to the GtkEditable interface that
make sense for most implementations.

7 years agoa11y: Update assistant test output
Matthias Clasen [Sun, 17 Feb 2019 20:36:45 +0000 (15:36 -0500)]
a11y: Update assistant test output

This changed as part of the recent cleanup that removed
some internal boxing.

7 years agoflowbox: Implement get_child_at_pos properly
Timm Bäder [Thu, 14 Feb 2019 06:11:34 +0000 (07:11 +0100)]
flowbox: Implement get_child_at_pos properly

With transforms in the mix, checking if the coordinate is inside the
widget "allocation" makes even less sense. Just use gtk_widget_pick()
and walk up until we find a GtkFlowBoxChild.

7 years agowidget: Push a transform node if we need to
Timm Bäder [Sat, 16 Feb 2019 14:29:05 +0000 (15:29 +0100)]
widget: Push a transform node if we need to

This is the same as the old code since the transformation only contains
teh offset right now, but it will be different later where arbitrary
transformations are possible per widget.

7 years agowidget: Save transform as matrix
Timm Bäder [Sat, 16 Feb 2019 13:40:49 +0000 (14:40 +0100)]
widget: Save transform as matrix

The transform matrix is a translation matrix from the parent's origin to
the widget origin. We will later allow more transformations than just
translations.

7 years agopaned: Implement increased handle area using pick()
Timm Bäder [Wed, 13 Feb 2019 14:37:54 +0000 (15:37 +0100)]
paned: Implement increased handle area using pick()

Otherwise, we do report the widgets below the invisible handle area as
hovered or active.

7 years agoMerge branch 'wip/otte/boxes' into 'master'
Matthias Clasen [Fri, 15 Feb 2019 16:12:26 +0000 (16:12 +0000)]
Merge branch 'wip/otte/boxes' into 'master'

GtkCssBoxes

See merge request GNOME/gtk!584

7 years agoMerge branch 'assistant-cleanup' into 'master'
Matthias Clasen [Fri, 15 Feb 2019 15:54:53 +0000 (15:54 +0000)]
Merge branch 'assistant-cleanup' into 'master'

Assistant cleanup

See merge request GNOME/gtk!581

7 years agoDrop GtkAssistantPage::has-padding
Matthias Clasen [Thu, 14 Feb 2019 19:46:01 +0000 (14:46 -0500)]
Drop GtkAssistantPage::has-padding

This is causing us some internal complications, and
it is very easy to just add padding to the pages
yourself.

7 years agoassistant: Use a stack
Matthias Clasen [Thu, 14 Feb 2019 19:07:46 +0000 (14:07 -0500)]
assistant: Use a stack

We don't use any non-stack features of the notebook here.

7 years agoassistant: Add docs
Matthias Clasen [Thu, 14 Feb 2019 19:29:54 +0000 (14:29 -0500)]
assistant: Add docs

Without this, introspection complains about a missing
transfer annotation.

7 years agosingleselection: Make tests build without warnings
Matthias Clasen [Fri, 15 Feb 2019 15:20:48 +0000 (10:20 -0500)]
singleselection: Make tests build without warnings

7 years agocss: Pass boxes to the render functions
Benjamin Otte [Fri, 15 Feb 2019 05:15:50 +0000 (06:15 +0100)]
css: Pass boxes to the render functions

Instead of style + rect_of_one_box, pass the new GtkCssBoxes object.
This has the nice side effect that when drawing background + border +
outline, we only compute all the boxes we need once.

7 years agocss: Mark some hot functions as G_GNUC_PURE
Benjamin Otte [Fri, 15 Feb 2019 03:06:22 +0000 (04:06 +0100)]
css: Mark some hot functions as G_GNUC_PURE

By doing that, gcc will generate code that avoids calling these
functions when not needed.

7 years agowidget: Make width, height and transform be widget-relative
Benjamin Otte [Fri, 15 Feb 2019 02:49:05 +0000 (03:49 +0100)]
widget: Make width, height and transform be widget-relative

Previously, those numbers stored the values relative to the margin box
of the widget. Now they store values relative to the content box,
thereby getting rid of the last remains of weird coordinate systems.

7 years agocssboxes: Introduce
Benjamin Otte [Fri, 15 Feb 2019 01:57:46 +0000 (02:57 +0100)]
cssboxes: Introduce

Split out the code for computing CSS boxes from given variables from the
background render code. This way, it can be shared between different
codebases.

Also, make that code completely be contained of static inline functions.
That ensures that it can be 100% inlined in cases where only parts of
the rectangle are needed (like in gtk_widget_get_width() in the future).

This will require some more patches to actually work, but those will
follow.

7 years agowidget: Store the render node in the widget's coordinate system
Benjamin Otte [Sun, 10 Feb 2019 05:26:41 +0000 (06:26 +0100)]
widget: Store the render node in the widget's coordinate system

Also require gtk_widget_snapshot() to be in the widget's coordinate
system.

7 years agoroot: Move the renderer to the root
Benjamin Otte [Sun, 10 Feb 2019 00:06:39 +0000 (01:06 +0100)]
root: Move the renderer to the root

7 years agoroot: Add gtk_root_get_surface_transform()
Benjamin Otte [Sat, 9 Feb 2019 21:15:32 +0000 (22:15 +0100)]
root: Add gtk_root_get_surface_transform()

The function isn't used yet, so this is just infrastructure.

7 years agoroot: Add GtkRoot:get_display vfunc
Benjamin Otte [Sun, 29 Jul 2018 02:11:14 +0000 (04:11 +0200)]
root: Add GtkRoot:get_display vfunc

And use it.

7 years agowidget: Add a GtkWidget::root property and gtk_widget_get_root()
Benjamin Otte [Sun, 29 Jul 2018 01:40:52 +0000 (03:40 +0200)]
widget: Add a GtkWidget::root property and gtk_widget_get_root()

The property is just for API completeness, the getter is meant to
replace toplevel usage.

7 years agowidget: Add GtkWidgetClass:root and :unroot functions
Benjamin Otte [Sun, 29 Jul 2018 01:31:36 +0000 (03:31 +0200)]
widget: Add GtkWidgetClass:root and :unroot functions

They get added whenever a widget gets added into a hierarchy with a root
widget.